package com.itheima.demo02;

import java.time.LocalDate;
import java.time.Period;

public class MainDemo04 {
    public static void main(String[] args) {
        LocalDate localDate1 = LocalDate.of(2020,12,12);
        LocalDate localDate2 = LocalDate.of(2028,10,9);

        Period period = Period.between(localDate1, localDate2);
        System.out.println(period);

        System.out.println(period.getYears());
        System.out.println(period.getMonths());
        System.out.println(period.getDays());

        System.out.println(period.toTotalMonths());
    }
}
